﻿namespace System.Modules.Extensions
{
    /// <summary>
    /// IsBetweenExtensions
    /// </summary>
    public static class IsBetweenExtensions
    {
        /// <summary>
        /// Checks if the value is less than or equal b and greater than or equal a
        /// </summary>
        /// <param name="value"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool IsBetween(this int value, int a, int b)
        {
            return value >= a && value <= b;
        }
        /// <summary>
        /// Checks if the value is less than or equal b and greater than or equal a
        /// </summary>
        /// <param name="value"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool IsBetween(this uint value, uint a, uint b)
        {
            return value >= a && value <= b;
        }
        /// <summary>
        /// Checks if the value is less than or equal b and greater than or equal a
        /// </summary>
        /// <param name="value"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool IsBetween(this decimal value, decimal a, decimal b)
        {
            return value >= a && value <= b;
        }
        /// <summary>
        /// Checks if the value is less than or equal b and greater than or equal a
        /// </summary>
        /// <param name="value"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool IsBetween(this double value, double a, double b)
        {
            return value >= a && value <= b;
        }
        /// <summary>
        /// Checks if the value is less than or equal b and greater than or equal a
        /// </summary>
        /// <param name="value"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool IsBetween(this float value, float a, float b)
        {
            return value >= a && value <= b;
        }
    }
}
